//
//  BGView.m
//  ICE_Player
//
//  Created by xl on 11-6-23.
//  Copyright 2011 __MyCompanyName__. All rights reserved.
//

#import "BGView.h"
#import "Globalize.h"
#include <unistd.h>
#include "ICE_global_var.h"

static BGView* g_last_bg_view = nil;

@implementation BGView

@synthesize file_list_view;
@synthesize configure_view;
@synthesize configure_btn;

@synthesize wifi_btn;
@synthesize msg_view;

@synthesize lock_files_btn;

@synthesize low_wnd;

@synthesize config_lb;
@synthesize wifi_lb;
@synthesize rotate_lb;

@synthesize psw_prt;
@synthesize psw_lb;
@synthesize psw_box;
@synthesize psw_mgr;

@synthesize player_view_controller;


- (id)initWithFrame:(CGRect)frame {
    
    self = [super initWithFrame:frame];
    if (self) {
        // Initialization code.
	}
    return self;
}


/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code.
}
*/

- (void)dealloc {
	[self destroy_SubViews];
    [super dealloc];
}

- (void)create_SubViews:(UIViewController*)controller
{
    [super create_SubViews:controller];
    
	CREATE_ICE_VIEW(configure_view, ConfigureView, controller);
	CREATE_ICE_VIEW(file_list_view, FileListView, controller);
	CREATE_ICE_VIEW(configure_btn, Config_Btn_View, controller);
	
	CREATE_ICE_VIEW(wifi_btn, WIFI_BTN, controller);
	
	CREATE_ICE_VIEW(lock_files_btn, lock_btn, controller);
    
    CREATE_ICE_VIEW(low_wnd, Low_Wnd_View, controller);
    CREATE_ICE_VIEW(msg_view, MSG_BOX_View, controller);
    
    CREATE_ICE_VIEW(config_lb,ICE_Hidable_Label_View,controller);
    CREATE_ICE_VIEW(wifi_lb,ICE_Hidable_Label_View,controller);
    CREATE_ICE_VIEW(rotate_lb,ICE_Hidable_Label_View,controller);
    
    CREATE_ICE_STRING_GLOBALIZE(wifi_mb_title, ICE_String, EG_STR_ID_MB_WIFI_TITLE);
    CREATE_ICE_STRING_GLOBALIZE(delete_mb_title, ICE_String, EG_STR_ID_MB_DELETE_TITLE);
    CREATE_ICE_STRING(wifi_mb_url, ICE_String);
    CREATE_ICE_STRING(delete_mb_file_name, ICE_String);
    
    //CREATE_ICE_VIEW(psw_lb, ICE_Label_View, controller);
    [controller.view addSubview:psw_prt];
    [psw_prt addSubview:psw_lb];
    [psw_prt addSubview:psw_box];
    
    psw_prt.hidden = YES;
    psw_lb.hidden = YES;
    psw_box.hidden = YES;
    
	msg_view.hidden = TRUE;
	configure_view.hidden = TRUE;
	configure_btn.hidden = FALSE;
    low_wnd.hidden = TRUE;
    
    low_wnd_has_shrinked = NO;
    //low_wnd.frame = CGRectMake(0.f, 380.f, 320.f, 100.f);
    g_last_bg_view = self;
    
#if IS_LITE_VERSION
    lock_files_btn.hidden = YES;
    rotate_lb.hidden = YES;
#endif
    
    config_lb.text = IGS(EG_STR_ID_BG_CONFIG_BTN);
    wifi_lb.text = IGS(EG_STR_ID_BG_WIFI_BTN);
    rotate_lb.text = IGS(EG_STR_ID_BG_LOCK_BTN);
    [wifi_mb_title replaceAllString:IGS(EG_STR_ID_MB_WIFI_TITLE)];
    [delete_mb_title replaceAllString:IGS(EG_STR_ID_MB_DELETE_TITLE)];
}

- (void)scale_to_fit_iPad
{
    if (self.image)
    {
        [self.image release];
    }
    self.image = [UIImage imageNamed:@RESOURCE_PATH_HD_BG];
    if (configure_view.image)
    {
        [configure_view.image release];
    }
    configure_view.image = [UIImage imageNamed:@RESOURCE_PATH_HD_PANEL_BG];
    if (low_wnd.p_bg_img.image)
    {
        [low_wnd.p_bg_img.image release];
    }
    low_wnd.p_bg_img.image = [UIImage imageNamed:@RESOURCE_PATH_HD_LOW_WND];
}

- (void) setHidden:(BOOL)enabled
{
	//msg_view.hidden = enabled;
	//configure_view.hidden = enabled;
    /*psw_prt.hidden = enabled;
    psw_lb.hidden = enabled;
    psw_box.hidden = enabled;*/
    
	configure_btn.hidden = enabled;
    wifi_btn.hidden = enabled;
    file_list_view.hidden = enabled;
    
    config_lb.hidden = enabled;
    wifi_lb.hidden = enabled;
    
#if IS_LITE_VERSION
    lock_files_btn.hidden = YES;
    rotate_lb.hidden = YES;
#else
    lock_files_btn.hidden = enabled;
    rotate_lb.hidden = enabled;
#endif
    
    if (enabled)
    {
        should_msg_box_restore = !msg_view.hidden;
        msg_view.hidden = TRUE;
        should_low_wnd_restore = !low_wnd.hidden;
        low_wnd.hidden = TRUE;
    }
    else
    {
        if(should_msg_box_restore)
        {
            msg_view.hidden = FALSE;
        }
        if (should_low_wnd_restore)
        {
            low_wnd.hidden = FALSE;
        }
    }
	super.hidden = enabled;
}

- (void)destroy_SubViews
{
    [psw_box removeFromSuperview];
    [psw_lb removeFromSuperview];
    [psw_prt removeFromSuperview];
    
    
    RELEASE_ICE_STRING(wifi_mb_url);
    RELEASE_ICE_STRING(delete_mb_file_name);
    RELEASE_ICE_STRING(wifi_mb_title);
    RELEASE_ICE_STRING(delete_mb_title);
    
    //RELEASE_ICE_VIEW(psw_lb);
    
    RELEASE_ICE_VIEW(rotate_lb);
    RELEASE_ICE_VIEW(wifi_lb);
    RELEASE_ICE_VIEW(config_lb);
    
	RELEASE_ICE_VIEW(configure_btn);
	RELEASE_ICE_VIEW(file_list_view);
	RELEASE_ICE_VIEW(configure_view);
	
	RELEASE_ICE_VIEW(wifi_btn);
	RELEASE_ICE_VIEW(msg_view);
	
	RELEASE_ICE_VIEW(lock_files_btn);
    
    RELEASE_ICE_VIEW(low_wnd);
    
    g_last_bg_view = nil;
}

- (void)On_Display_Cfg_View
{
	configure_view.hidden = FALSE;
}

- (void)On_Hide_Cfg_View
{
	configure_view.hidden = TRUE;
}

- (void)On_Display_List_View
{
	configure_btn.hidden = FALSE;
	wifi_btn.hidden = FALSE;
#if IS_LITE_VERSION
    lock_files_btn.hidden = YES;
    rotate_lb.hidden = YES;
#else
    lock_files_btn.hidden = FALSE;
    rotate_lb.hidden = FALSE;
#endif
    
    config_lb.hidden = FALSE;
    wifi_lb.hidden = FALSE;
    
    if (should_msg_box_restore)
    {
        msg_view.hidden = FALSE;
    }
    else
    {
        file_list_view.hidden = FALSE;
        if (should_low_wnd_restore)
        {
            low_wnd.hidden = FALSE;
        }
    }
}

- (void)On_Hide_List_View
{
	configure_btn.hidden = TRUE;
	wifi_btn.hidden = TRUE;
	lock_files_btn.hidden = TRUE;
    file_list_view.hidden = TRUE;
    
    should_msg_box_restore = !msg_view.hidden;
    msg_view.hidden = TRUE;
    
    config_lb.hidden = TRUE;
    wifi_lb.hidden = TRUE;
    rotate_lb.hidden = TRUE;
    
    if (!should_msg_box_restore)
    {
        should_low_wnd_restore = !low_wnd.hidden;
        low_wnd.hidden = TRUE;
    }
    else
    {
        should_low_wnd_restore = FALSE;
    }
}

- (IBAction)On_Call_Cfg_View:(id)sender
{
	[self On_Hide_List_View];
	[self On_Display_Cfg_View];
}

- (IBAction)On_Leave_Cfg_View:(id)sender
{
	[self On_Hide_Cfg_View];
	[NSTimer scheduledTimerWithTimeInterval:0.4f target:self selector:@selector(On_Display_List_View) userInfo:nil repeats:NO];
}

- (IBAction)On_Call_WIFI_View:(id)sender
{
    file_list_view.hidden = TRUE;
    wifi_btn.hidden = TRUE;
    wifi_lb.hidden = TRUE;
    configure_btn.hidden = TRUE;
    config_lb.hidden = TRUE;
    lock_files_btn.hidden = YES;
    rotate_lb.hidden = YES;
    should_low_wnd_restore_from_wifi_view = !low_wnd.hidden;
    low_wnd.hidden = TRUE;
    wifi_mb_url.string = web_server_get_local_url(g_web_server_handle);
    [msg_view Show_Box:MT_WIFI_BOX title_content:wifi_mb_title msg_content:wifi_mb_url parent_view:self.superview result_obj:self result_notify:@selector(On_Leave_WIFI_View:)];
}

- (IBAction)On_Leave_WIFI_View:(BOOL)result
{
	if (self.hidden)
	{
		return;
	}
	
	if (result)
	{
		
	}
	else
	{
	}
    
    file_list_view.hidden = FALSE;
    if (should_low_wnd_restore_from_wifi_view)
    {
        low_wnd.hidden = FALSE;
    }
    wifi_btn.hidden = FALSE;
    wifi_lb.hidden = FALSE;
    configure_btn.hidden = FALSE;
    config_lb.hidden = FALSE;
    
#if IS_LITE_VERSION
    lock_files_btn.hidden = YES;
    rotate_lb.hidden = YES;
#else
    lock_files_btn.hidden = FALSE;
    rotate_lb.hidden = FALSE;
#endif
    
}

- (void)On_Push_Out_And_Hide_Self
{
	UIApplication* app = [UIApplication sharedApplication];
	[app setStatusBarHidden:TRUE withAnimation:UIStatusBarAnimationSlide];
	self.superview.frame = [UIScreen mainScreen].bounds;
	//[app setStatusBarOrientation:UIDeviceOrientationLandscapeLeft animated:TRUE];
	
	
	CATransition *animation = [CATransition animation];
	animation.delegate = self;
	animation.duration = 0.3f;
	animation.timingFunction = UIViewAnimationCurveEaseInOut;
	animation.fillMode = kCAFillModeRemoved;//kCAFillModeBackwards;//
	animation.type = kCATransitionPush;//@"rippleEffect";//110
	animation.subtype = kCATransitionFromRight;//kCATransitionFromTop;
	//animation.endProgress = 1.0;
	//animation.removedOnCompletion = NO;
	
	//[self.layer addAnimation:animation forKey:@"animation"];
	[self.layer addAnimation:animation forKey:@"animation"];
    
#if 0
    //for unknown BUG
    //release all the image to save memories
    if (self.image)
    {
        [self.image release];
        printf("self cnt = %d\n", self.image.retainCount);
        self.image = NULL;
    }
    if (configure_view.image)
    {
        [configure_view.image release];
        printf("configure_view cnt = %d\n", configure_view.image.retainCount);
        configure_view.image = NULL;
    }
    if (low_wnd.p_bg_img.image)
    {
        [low_wnd.p_bg_img.image release];
        printf("low_wnd cnt = %d\n", low_wnd.p_bg_img.image.retainCount);
        low_wnd.p_bg_img.image = NULL;
    }
    //end release
#endif
    
	self.hidden = TRUE;
}

- (void)On_Finish_Display_Self
{
    self.superview.frame = [UIScreen mainScreen].applicationFrame;
	self.hidden = FALSE;
}

- (void)On_Push_In_And_Display_Self
{
    if (get_device_type() == DVC_TYPE_IPAD)
    {
        if (!self.image)
        {
            self.image = [UIImage imageNamed:@RESOURCE_PATH_HD_BG];
            printf("self cnt = %d\n", self.image.retainCount);
        }
        if (!configure_view.image)
        {
            configure_view.image = [UIImage imageNamed:@RESOURCE_PATH_HD_PANEL_BG];
            printf("configure_view cnt = %d\n", configure_view.image.retainCount);
        }
        if(!low_wnd.p_bg_img.image)
        {
            low_wnd.p_bg_img.image = [UIImage imageNamed:@RESOURCE_PATH_HD_LOW_WND];
            printf("low_wnd cnt = %d\n", low_wnd.p_bg_img.image.retainCount);
        }
    }
    else
    {
        if (!self.image)
        {
            self.image = [UIImage imageNamed:@RESOURCE_PATH_BG];
        }
        if (!configure_view.image)
        {
            configure_view.image = [UIImage imageNamed:@RESOURCE_PATH_PANEL_BG];
        }
        if(!low_wnd.p_bg_img.image)
        {
            low_wnd.p_bg_img.image = [UIImage imageNamed:@RESOURCE_PATH_LOW_WND];
        }
    }
    
    UIApplication* app = [UIApplication sharedApplication];
    [app setStatusBarHidden:FALSE withAnimation:UIStatusBarAnimationSlide];
	super.hidden = FALSE;
	CATransition *animation = [CATransition animation];
	animation.delegate = self;
	animation.duration = 0.2f;
	animation.timingFunction = UIViewAnimationCurveEaseInOut;
	animation.fillMode = kCAFillModeForwards;//kCAFillModeBackwards;//
	animation.type = kCATransitionPush;//@"rippleEffect";//110
	animation.subtype = kCATransitionFromLeft;//kCATransitionFromTop;
	//animation.endProgress = 1.0;
	//animation.removedOnCompletion = NO;
	
	//[self.layer addAnimation:animation forKey:@"animation"];
	[self.layer addAnimation:animation forKey:@"animation"];
	[NSTimer scheduledTimerWithTimeInterval:0.25f target:self selector:@selector(On_Finish_Display_Self) userInfo:nil repeats:NO];
}

- (void)On_Call_Player_View:(char*)url
{
	[player_view_controller On_Display_Player_View:url];
	[self On_Push_Out_And_Hide_Self];
    is_lock_screen_disabled_before_enter_player = [UIApplication sharedApplication].idleTimerDisabled;
    [UIApplication sharedApplication].idleTimerDisabled = YES;
}

- (IBAction)On_Leave_Player_View:(id)sender
{
	[player_view_controller On_Hide_Player_View];
	[self On_Push_In_And_Display_Self];
    [UIApplication sharedApplication].idleTimerDisabled = is_lock_screen_disabled_before_enter_player;
}

- (void)On_Leave_Delete_File_View:(BOOL)result
{
    if (result)
    {
        [self On_Leave_Low_Wnd];
        [file_list_view.p_mgr delete_selected_file];
    }
    file_list_view.hidden = FALSE;
    configure_btn.hidden = FALSE;
    wifi_btn.hidden = FALSE;
    config_lb.hidden = FALSE;
    wifi_lb.hidden = FALSE;
    
#if IS_LITE_VERSION
    lock_files_btn.hidden = YES;
    rotate_lb.hidden = YES;
#else
    lock_files_btn.hidden = FALSE;
    rotate_lb.hidden = FALSE;
#endif
    
}

- (IBAction)On_Call_Delete_File_View:(id)sender
{
    configure_btn.hidden = TRUE;
    config_lb.hidden = TRUE;
    wifi_btn.hidden = TRUE;
    wifi_lb.hidden = TRUE;
    lock_files_btn.hidden = YES;
    rotate_lb.hidden = YES;
    file_list_view.hidden = TRUE;
    FileList_Cell* pcell = [file_list_view cellForRowAtIndexPath:[file_list_view indexPathForSelectedRow]];
    [delete_mb_file_name replaceAllString:pcell.file_name.text];
    [msg_view Show_Box:MT_FILE_DELETE_BOX title_content:delete_mb_title msg_content:delete_mb_file_name parent_view:self.superview result_obj:self result_notify:@selector(On_Leave_Delete_File_View:)];
}

- (void)On_Shrink_In_List_View
{
    if (low_wnd_has_shrinked)
    {
        return;
    }
    low_wnd_has_shrinked = YES;
    CGRect low_rect = low_wnd.bounds;
    CGRect self_rect = self.bounds;
    
    CGRect rect = file_list_view.bounds;
    CGPoint pnt = file_list_view.center;
    rect.origin.x = 0.f;
    rect.origin.y = 88.f;

    rect.size.height -= low_rect.size.height;
    pnt.y = rect.origin.y + (0.5f * rect.size.height);
    file_list_view.bounds = rect;
    file_list_view.center = pnt;
    
    [file_list_view scrollToNearestSelectedRowAtScrollPosition:UITableViewScrollPositionMiddle animated:NO];
}

- (void)On_Shrink_Out_List_View
{
    if (!low_wnd_has_shrinked)
    {
        return;
    }
    low_wnd_has_shrinked = NO;
    
    CGRect low_rect = low_wnd.bounds;
    CGRect self_rect = self.bounds;
        
    CGRect rect = file_list_view.bounds;
    CGPoint pnt = file_list_view.center;
    rect.origin.x = 0.f;
    rect.origin.y = 88.f;
    
    rect.size.height = self_rect.size.height - rect.origin.y;
    pnt.y = rect.origin.y + (0.5f * rect.size.height);
    
    file_list_view.bounds = rect;
    file_list_view.center = pnt;
    
    [file_list_view scrollToNearestSelectedRowAtScrollPosition:UITableViewScrollPositionMiddle animated:NO];
}

- (void)On_Show_Low_Wnd:(char*)url
{
    [self On_Shrink_In_List_View];
    [low_wnd On_Show:url parent_view:self];
}

- (void)On_Leave_Low_Wnd
{
    [low_wnd On_Leave];
    [self On_Shrink_Out_List_View];
}

+ (BGView*)get_Last_BG_view
{
    return g_last_bg_view;
}

- (void)On_Hide_All_Controls
{
    configure_btn.hidden = TRUE;
    config_lb.hidden = TRUE;
    wifi_btn.hidden = TRUE;
    wifi_lb.hidden = TRUE;
    file_list_view.hidden = TRUE;
    should_low_wnd_restore_from_psw_view = !low_wnd.hidden;
    low_wnd.hidden = TRUE;
    lock_files_btn.hidden = YES;
    rotate_lb.hidden = YES;
}

- (void)On_Display_All_Controls
{
    configure_btn.hidden = NO;
    config_lb.hidden = NO;
    wifi_btn.hidden = NO;
    wifi_lb.hidden = NO;
    file_list_view.hidden = NO;
#if IS_LITE_VERSION
    lock_files_btn.hidden = YES;
    rotate_lb.hidden = YES;
#else
    lock_files_btn.hidden = NO;
    rotate_lb.hidden = NO;
#endif
    
    if (should_low_wnd_restore_from_psw_view)
    {
        low_wnd.hidden = NO;
    }
}

- (void)On_Call_Passwords_View:(BOOL)lock;
{
    {
        CGRect prt_rect = self.bounds;
        CGPoint prt_pnt = self.center;
        
        CGRect rect = psw_prt.bounds;
        CGPoint pnt = psw_prt.center;
        rect.origin.x = prt_rect.size.width * 0.5f - (0.5f * rect.size.width);
        rect.origin.y = prt_rect.size.height * 0.5f - (0.5f * rect.size.height);
        pnt.x = rect.origin.x + (0.5f * rect.size.width);
        pnt.y = rect.origin.y + (0.5f * rect.size.height);
        psw_prt.bounds = rect;
        psw_prt.center = pnt;
        
        
        prt_rect = psw_prt.bounds;
        prt_pnt = psw_prt.center;
        rect = psw_lb.bounds;
        pnt = psw_lb.center;
        rect.origin.x = prt_pnt.x - (0.5f * rect.size.width);
        rect.origin.y = prt_rect.origin.y;
        pnt.x = rect.origin.x + (0.5f * rect.size.width);
        pnt.y = rect.origin.y + (0.5f * rect.size.height);
        psw_lb.bounds = rect;
        psw_lb.center = pnt;
        
        prt_rect = psw_lb.bounds;
        prt_pnt = psw_lb.center;
        rect = psw_box.bounds;
        pnt = psw_box.center;
        rect.origin.x = prt_pnt.x - (0.5f * rect.size.width);
        rect.origin.y = prt_rect.origin.y + prt_rect.size.height;
        pnt.x = rect.origin.x + (0.5f * rect.size.width);
        pnt.y = rect.origin.y + (0.5f * rect.size.height);
        psw_box.bounds = rect;
        psw_box.center = pnt;
         
        
        rect = psw_box.bounds;
        pnt = psw_box.center;
        
        rect = psw_lb.bounds;
        pnt = psw_lb.center;
        
        pnt.x = pnt.y;
    }
    
    switch (get_device_type())
    {
        case DVC_TYPE_IPHONE3:
        case DVC_TYPE_IPHONE4:
            {
#define MOVE_UP_PARTION 1.0f
                CGRect prect = psw_prt.bounds;
                CGFloat move_up_pixels = prect.origin.y * MOVE_UP_PARTION;
                CGRect rect = psw_prt.bounds;
                CGPoint pnt = psw_prt.center;
                rect.origin.y -= move_up_pixels;
                pnt.y -= move_up_pixels;
                psw_prt.bounds = rect;
                psw_prt.center = pnt;
                
                
                rect = psw_lb.bounds;
                pnt = psw_lb.center;
                rect.origin.y -= move_up_pixels;
                pnt.y -= move_up_pixels;
                psw_lb.bounds = rect;
                psw_lb.center = pnt;
                
                rect = psw_box.bounds;
                pnt = psw_box.center;
                rect.origin.y -= move_up_pixels;
                pnt.y -= move_up_pixels;
                psw_box.bounds = rect;
                psw_box.center = pnt;
            }
            break;
        case DVC_TYPE_IPAD:
            {
#define MOVE_UP_PARTION_IPAD 0.3f
                CGRect prect = psw_prt.bounds;
                CGFloat move_up_pixels = prect.origin.y * MOVE_UP_PARTION_IPAD;
                CGRect rect = psw_prt.bounds;
                CGPoint pnt = psw_prt.center;
                rect.origin.y -= move_up_pixels;
                pnt.y -= move_up_pixels;
                psw_prt.bounds = rect;
                psw_prt.center = pnt;
            
            
                rect = psw_lb.bounds;
                pnt = psw_lb.center;
                rect.origin.y -= move_up_pixels;
                pnt.y -= move_up_pixels;
                psw_lb.bounds = rect;
                psw_lb.center = pnt;
            
                rect = psw_box.bounds;
                pnt = psw_box.center;
                rect.origin.y -= move_up_pixels;
                pnt.y -= move_up_pixels;
                psw_box.bounds = rect;
                psw_box.center = pnt;
            }
            break;
        default:
            break;
    }
    
    if (lock)
    {
        psw_lb.text = IGS(EG_STR_ID_PSW_SET);
    }
    else
    {
        psw_lb.text = IGS(EG_STR_ID_PSW_INPUT);
    }
    
    psw_box.text = @"";
    
    psw_box.hidden = NO;
    psw_lb.hidden = NO;
    psw_prt.hidden = NO;
    
}

- (void)On_Confirmed_Passwords
{
    psw_box.hidden = YES;
    psw_lb.text = IGS(EG_STR_ID_PSW_CONFIRM);
    psw_lb.hidden = NO;
    psw_prt.hidden = NO;
}

- (void)On_Wrong_Passwords
{
    psw_box.hidden = YES;
    psw_lb.text = IGS(EG_STR_ID_PSW_WRONG);
    psw_lb.hidden = NO;
    psw_prt.hidden = NO;
}

- (void)On_leave_Passwords_View
{
    psw_box.hidden = YES;
    psw_lb.hidden = YES;
    psw_prt.hidden = YES;
}

- (void)On_Leave_Change_Psw_MB:(BOOL)result
{
    if (result)
    {
        [self On_Call_Passwords_View:YES];
    }
    else
    {
        [psw_mgr Lock_files];
    }
}

- (void)On_Call_Change_Psw_MB
{
    psw_box.hidden = YES;
    psw_lb.hidden = YES;
    psw_prt.hidden = YES;
    [msg_view Show_Box_NSString:MT_YESNO_BTN_BOX title_content:IGS(EG_STR_ID_PSW_RESET_PSW) msg_content:@"" parent_view:self.superview result_obj:self result_notify:@selector(On_Leave_Change_Psw_MB:)];
}

- (void)On_leave_Psw_Confirm_MB:(BOOL)result
{
    if (result)
    {
        [psw_mgr Lock_files];
    }
    else
    {
        [self On_Call_Passwords_View:YES];
    }
}

- (void)On_Call_Psw_Confirm_MB:(NSString*)passwords
{
    psw_box.hidden = YES;
    psw_lb.hidden = YES;
    psw_prt.hidden = YES;
    [msg_view Show_Box_NSString:MT_DOUBLE_BTN_BOX title_content:IGS(EG_STR_ID_PSW_NEW_PSW_IS) msg_content:passwords parent_view:self.superview result_obj:self result_notify:@selector(On_leave_Psw_Confirm_MB:)];
}

@end
